<?php 
// The IP address of your database
$db_ip = 'fdb1.awardspace.com';           

$db_user = 'experimenter_s3p';
$db_pass = 'carkhana';

// the name of the database that you create for footprints.
$db_name = 'experimenter_s3p';

// Create a common connection
$db_connection = null;

// creates and returns a DB connection
function get_db_conn() {
	global $db_connection;
	if(null == $db_connection)
	{
	  $conn = mysql_connect($GLOBALS['db_ip'], $GLOBALS['db_user'], $GLOBALS['db_pass']);
	  mysql_select_db($GLOBALS['db_name'], $conn);
	  	$db_connection = $conn;
	}
	return $db_connection;
}		

// method to execute an update query
function execute_update($q) {
	$conn = get_db_conn();
	$result = mysql_query($q, $conn);
	if(!$result) {
		echo 'Update failed: ' . mysql_error();
	}
	return $result;
}

// method to execute an select query
function execute_select($q) {
	$conn = get_db_conn();
	$result = mysql_query($q, $conn);
	if(!$result) {
		echo 'Select failed: ' . mysql_error();
	}
	return $result;
}
?>